import request from '@/utils/request'
//热搜列表(详细)
export function getSearchHotDetail() {
    return request({
        url: '/search/hot/detail',
        method: 'get'
    })
}
//默认搜索关键词
export function getSearchDefault() {
    return request({
        url: '/search/default',
        method: 'get'
    })
}


//二维码登录
//1. 二维码 key 生成接口
export function getLoginQrKey() {
    return request({
        url: '/login/qr/key',
        method: 'get'
    })
}

//2. 生成二维码
export function getLoginQrCreate(key) {
    return request({
        url: '/login/qr/create',
        method: 'get',
        params: {
            key: key,
            qrimg: true,
            t: Date.now()
        }
    })
}

//3. 二维码检测扫码状态接口
export function getLoginQrCheck(key) {
    return request({
        url: '/login/qr/check',
        method: 'get',
        params: {
            key: key,
            t: Date.now()
        }
    })
}

//游客登录
export function registerAnonimous() {
    return request({
        url: '/register/anonimous',
        method: 'get'
    })
}

//获取用户信息
export function getUserAccount() {
    return request({
        url: '/user/account',
        method: 'get',
        params: {
            t: Date.now()
        }
    })
}

//获取用户详情
export function getUserDetail(uid) {
    return request({
        url: '/user/detail',
        method: 'get',
        params: {
            uid: uid,
            t: Date.now()
        }
    })
}

//刷新登录
export function getLoginRefresh() {
    return request({
        url: '/login/refresh',
        method: 'get'
    })
}

//登出
export function getLogout() {
    return request({
        url: '/logout',
        method: 'get'
    })
}

//手机号密码登录
export function loginCellphone(params) {
    return request({
        url: '/login/cellphone',
        method: 'get',
        params
    })
}